home *** CD-ROM | disk | FTP | other *** search
- Path: bcfreenet.seflin.lib.fl.us!bcfreenet!z007400b
- From: z007400b@bcfreenet.seflin.lib.fl.us (Ralph Silverman)
- Newsgroups: comp.lang.c
- Subject: Re: Pound defines
- Date: 30 Jan 1996 18:31:19 GMT
- Organization: SEFLIN Free-Net - Broward
- Message-ID: <4elo5n$h9u@bcfreenet.seflin.lib.fl.us>
- References: <4dgquf$fuq@bmerhc5e.bnr.ca> <4dp5sl$9t8@spanky.pls.ov.com>
- NNTP-Posting-Host: bcfreenet.seflin.lib.fl.us
- X-Newsreader: TIN [version 1.2 PL2]
-
- Fletcher.Glenn@ov.com (glenn@ov.com) wrote:
- : In article fuq@bmerhc5e.bnr.ca, studnt1@bmerhe78.bnr.ca (Jean Giblin ) writes:
- : >hello everyone:
- : >
- : > I was wondering if anybody out there knows about a C command that prints the
- : >the name of the define when given the number. Example:
- : >
- : > #define MAX 20
- : >
- : >when given 20 it will return max.
- : >
- : >I thought a command existed, but I could be wrong. Please respond to this newgroup,
- : >and not my e-mail address.
- : >
- : > Thanks
- : > Nick
-
-
- : All of the directives that start with # are C pre-processor directives. These
- : directives are all resolved before compiling begins. This means for your
- : example that all references to MAX are replaced with 20. To see what I mean,
- : see if your compiler will output the actual source after pre-processing.
- : On most UNIX compilers the command is "cc -E filename.c"
-
- : Given that the defines disappear before compiling, there is no way to work
- : backwards from the value. Besides, how would one handle the following?
-
- : #define FOO 20
- : #define BAR 20
- : #define BLECH 20
-
- : Fletcher.Glenn@ov.com
-
-
-
- --
- **********begin r.s. response***********
-
- if your os is
- (ms pc dr)dos
- the 'find'
- command on it can be
- used if applied to the
- source file
- .
-
- in unix systems
- there is a suitable
- command as well.
-
- by the way,
- frequently,
- and reasonably,
- more then one term is
- #define
- the same value...
-
- **********end r.s. response*************
- Ralph Silverman
- z007400b@bcfreenet.seflin.lib.fl.us
-
-